package com.netrust.cmsx.core.resp;

import java.io.Serializable;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * 通用返回
 * @author lazite
 *
 * @param <T>
 */
@SuppressWarnings("deprecation")
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class RespJson<T> extends Response<T> implements Serializable {
	private static final long serialVersionUID = 1114120443117189208L;

	private boolean  success  ;
	 
	private Integer  code  ;
    
	private String  description;
	 
	private T result;
	
	public RespJson() {
		super();
	}
	
	/**
	 * @param success
	 * @param code
	 */
	public RespJson(boolean success,Integer code) {
		super();
		this.success = success;
		this.code = code;
	}

	public RespJson(boolean success, Integer code, String description) {
		super();
		this.success = success;
		this.code = code;
		this.description = description;
	}

	public RespJson(boolean success, Integer code, String description, T result) {
		super();
		this.success = success;
		this.code = code;
		this.description = description;
		this.result = result;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public T getResult() {
		return result;
	}

	public void setResult(T result) {
		this.result = result;
	}

	@Override
	public String toString() {
		return "CommonDefinedResponse [success=" + success + ", code=" + code + ", description=" + description
				+ ", result=" + result + "]";
	}
	
}
